cd "/Users/ge23kiq/OneDrive/udligning"

*** Use this data for analysis
use polingstation_data_foranalysis_.dta, replace

xtset kommunenr valgstedid

** Coefficient plots

* Incumbent

xtreg socdemvotes_2022 nythovedstat Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov socdemvotes_2019, re vce(cluster id)

estimates store B

xtreg socdemvotes_2022 nytoeogyder Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov socdemvotes_2019, re vce(cluster id)

estimates store C

xtreg socdemvotes_2022 saerligkompensation Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov socdemvotes_2019, re vce(cluster id)

estimates store D

coefplot  (B, label(Metropolitan Grant)) (C, label(Island and Rural Grant)) (D, label(Special Compensation Grant)), keep(PRINDBYGGERIALTTABGEVINSTV nythovedstat nytoeogyder saerligkompensation ) xline(0) ylabel(none) scheme(plotplain)

* Incumbent + supporters
xtreg socdemcoalition_2022 nythovedstat Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov socdemcoalition_2019, re vce(cluster id)

estimates store A

xtreg socdemcoalition_2022 nytoeogyder Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov socdemcoalition_2019, re vce(cluster id)

estimates store B

xtreg socdemcoalition_2022 saerligkompensation Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov socdemcoalition_2019, re vce(cluster id)

estimates store C

coefplot (A, label(Metropolitan Grant)) (B, label(Island and Rural Grant)) (C, label(Special Compensation Grant)), keep(nythovedstat nytoeogyder saerligkompensation ) xline(0) ylabel(none) scheme(plotplain)

* reform coalition

xtreg reformcoalition_2022 nythovedstat Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov reformcoalition_2019, re vce(cluster id)

estimates store A

xtreg reformcoalition_2022 nytoeogyder Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov reformcoalition_2019, re vce(cluster id)

estimates store B

xtreg reformcoalition_2022 saerligkompensation Antalindbyggerepr1januar20 elderly inequality unemployment adultpopulation beskatningprind ingenerhversud udgiftsbehov reformcoalition_2019, re vce(cluster id)

estimates store C

coefplot (A, label(Metropolitan Grant)) (B, label(Island and Rural Grant)) (C, label(Special Compensation Grant)), keep(nythovedstat nytoeogyder saerligkompensation ) xline(0) ylabel(none) scheme(plotplain)
